package cn.getech.data.metadata.model.req.collectiontask;

import cn.getech.data.intelligence.common.validator.group.AddGroup;
import cn.getech.data.intelligence.common.validator.group.UpdateGroup;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.List;

@ApiModel(description = "添加采集任务请求")
@Data
public class CollectionTaskAutoUpdateReq {

    @ApiModelProperty(value = "任务id")
    @NotNull(message = "任务id不能为空", groups = {AddGroup.class, UpdateGroup.class})
    private Long taskId;

    @ApiModelProperty(value = "任务名称")
    @NotBlank(message = "任务名称不能为空", groups = {AddGroup.class, UpdateGroup.class})
    private String taskName;

    @ApiModelProperty(value = "任务类型")
    @NotNull(message = "任务类型不能为空", groups = {AddGroup.class, UpdateGroup.class})
    private Integer taskType;

    @ApiModelProperty(value = "所属系统")
    private Integer ownSystem;

    @ApiModelProperty(value = "所属模块")
    @NotNull(message = "所属模块id不能为空", groups = {AddGroup.class, UpdateGroup.class})
    private Integer ownModule;

    @ApiModelProperty(value = "数据源类型")
    @NotBlank(message = "数据源类型不能为空", groups = {AddGroup.class, UpdateGroup.class})
    private String sourceType;

    @ApiModelProperty(value = "数据源")
    @NotNull(message = "数据源不能为空", groups = {AddGroup.class, UpdateGroup.class})
    private Long sourceId;

    @ApiModelProperty(value = "调度方式 1:正常 2:暂停")
    @NotNull(message = "调度方式不能为空", groups = {AddGroup.class, UpdateGroup.class})
    private Integer scheduleEnable;

    @ApiModelProperty(value = "循环方式 1:定时运行 2:循环运行")
    @NotNull(message = "循环方式不能为空", groups = {AddGroup.class, UpdateGroup.class})
    private Integer scheduleMode;

    @ApiModelProperty(value = "调度方式 间隔(1:时 2:日) 定时(3:每小时 4:每日 5:每周 6:每月)")
    @NotNull(message = "调度方式不能为空", groups = {AddGroup.class, UpdateGroup.class})
    private Integer scheduleUnit;

    @ApiModelProperty(value = "调度方式间隔 调度方式值")
    private Integer intervalValue;

    @ApiModelProperty(value = "调度方式定时 分")
    private Integer scheduleMinute;
    @ApiModelProperty(value = "调度方式定时 时")
    private Integer scheduleHour;
    @ApiModelProperty(value = "调度方式定时 天或者周")
    private Integer scheduleDay;

    @ApiModelProperty(value = "初始权限角色")
    @NotNull(message = "初始权限角色不能为空", groups = {AddGroup.class, UpdateGroup.class})
    private Long initRole;

    @ApiModelProperty(value = "数据库列表")
    @NotEmpty(message = "数据库列表不能为空", groups = {AddGroup.class, UpdateGroup.class})
    private List<String> dbNames;

    @ApiModelProperty("通知用户组id")
    private List<Long>  userGroupNameId;

    @ApiModelProperty("资产目录")
    private List<String> categoryIdsList;
}
